//Fighter.java
package com.xyc.ch5;

class Airplane
{
	private int speed;
	public Airplane(int s)
	{
		speed=s;
		System.out.println("import structure function Airplane(int s)");
	}
 }

class Warplane extends Airplane
{
	public Warplane()
	{
//		this(3);//调用所属类的另一个构造方法，如果其执行那么super(600);将不再执行；
		super(600);
		System.out.println("import structure function Warplane()");
	}
	public Warplane(int s)
	{
		super(s);
		System.out.println("import structure function Warplane(int s)");
	}
}

public class Fighter extends Warplane
{
	public Fighter()
	{
		super();				//可省略
		System.out.println("import structure function Fighter()");
	}
	public Fighter(int s)
	{
		super(s);
		System.out.println("import structure function Fighter(int s)");
	}
	public static void main(String[] args)
	{
		System.out.println("create object: Fighter f1=new Fighter()");
		Fighter f1=new Fighter();
		System.out.println("\n create object: Fighter f2=new Fighter(500)");
		Fighter f2=new Fighter(500);
	}
}
